import service from "../utils/request";

//  宿主机列表
export function getTagList(params:any) {
  return service.get(`/dict/data`, { params });
}
export function createTagList(data:any) {
  return service.post(`/dict/data`, data);
}
export function editTagList(id:number,data:any) {
  return service.post(`/storage/${id}/label`,data);
}
export function deleteTagList(id:number) {
  return service.delete(`/dict/data/${id}`);
}


// 列表
export function getLabelList(params:any) {
  return service.get(`/project-labels`, {params});
}
// 增
export function createLabel(data:any) {
  return service.post(`/project-labels`, data);
}
// 改
export function editLabel(id:number,data:any) {
  return service.put(`/project-labels/${id}`,data);
}
// 删
export function deleteLabel(data:any) {
  return service.delete(`/project-labels`,{data});
}
// 查
export function getLabelDetail(id:number) {
  return service.get(`/project-labels/${id}`);
}
// 是否启用
export function editRequired(id:number,data:any) {
  return service.put(`/project-labels/${id}/required`,data);
}


// 选项列表 - 列表
export function getOptionsList(params:any,id:number) {
  return service.get(`/project-labels/${id}/options`, {params});
}
// 选项列表 - 增
export function createOptions(id:number,data:any) {
  return service.post(`/project-labels/${id}/options`, data);
}
// 选项列表 - 改
export function editOptions(id:number,data:any) {
  return service.put(`/project-labels/${id}/options/`,data);
}
// 选项列表 - 删
export function deleteOptions(id:number,data:any) {
  return service.delete(`/project-labels/${id}/options`,{data});
}
// 选项列表 - 查
export function getLabelOptions(id:number) {
  return service.get(`/project-labels/${id}/options/`);
}